/**
 * Copyright © 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.cms.guestbook.mapper;

import com.jeeplus.core.persistence.BaseMapper;
import com.jeeplus.modules.cms.guestbook.entity.CmsGuestbook;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

/**
 * 留言表MAPPER接口
 *
 * @author Sawyer
 * @version 2020-11-22
 */
@Mapper
@Repository
public interface CmsGuestbookMapper extends BaseMapper<CmsGuestbook> {

    /**
     * 更新过期权重
     *
     * @param cmsGuestbook 内容
     * @return 受影响记录数
     */
    void updateExpiredWeight(CmsGuestbook cmsGuestbook);

    /**
     * 获取评价数据
     *
     * @param guestbook 留言板
     * @return CmsGuestbook or null
     */
    CmsGuestbook getEvalu(CmsGuestbook guestbook);

    /**
     * 赞成+1
     *
     * @param guestbook 留言
     * @return 受影响记录数
     */
    int agree(CmsGuestbook guestbook);

    /**
     * 反对+1
     *
     * @param guestbook 留言
     * @return 受影响记录数
     */
    int oppose(CmsGuestbook guestbook);
}
